package com.chinatelecom.ctyun.xstore.vod.demo.exception;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import com.chinatelecom.ctyun.xstore.vod.demo.common.RestfulResponseVO;
import com.ctyun.xstore.vod.ServerErrorException;

@RestControllerAdvice
public class RestfultApiExceptionHandler {

	@ExceptionHandler(ServerErrorException.class)
	public RestfulResponseVO controllerExceptionHandler(ServerErrorException ex) {
		return new RestfulResponseVO(ex.getHttpCode(), ex.getErrorMessage());
	}
}
